﻿using System.Collections.ObjectModel;

namespace Digitalmes.Gallery.ViewModels.Windows;

public partial class MainWindowViewModel : ObservableObject
{
    private readonly INavigationViewService _menuService;
    private readonly IOptions<AppConfig> _options;

    public MainWindowViewModel(INavigationViewService menuService, IOptions<AppConfig> options)
    {
        _menuService = menuService;
        _options = options;

        ApplicationTitle = _options.Value.Title ?? string.Empty;

        MenuItems = new(_menuService.GetNavigationViews());
    }

    [ObservableProperty]
    private string _applicationTitle;

    [ObservableProperty]
    private ObservableCollection<object> _menuItems;

    [ObservableProperty]
    private ObservableCollection<object> _footerMenuItems =
    [
        new NavigationViewItem()
        {
            Content = "设置",
            Icon = new SymbolIcon { Symbol = SymbolRegular.Settings24 },
            TargetPageType = typeof(SettingsPage)
        }
    ];
}
